import random
import math
import sys
import getopt

opts, args = getopt.getopt(sys.argv[1:], "vpm:x:y:z:i:j:k:")

velocity = False
polar = False
offsets = [0, 0, 0]
voffsets = [0, 0, 0]
mass = 1.0

for o, a in opts:
	if o == "-v":
		velocity = True
	elif o == "-p":
		polar = True
	elif o == "-m":
		mass = float(a)
	elif o == "-x":
		offsets[0] = float(a)
	elif o == "-i":
		voffsets[0] = float(a)

for i in xrange(int(args[0])):
	if (polar):
		theta = random.random()*2.0*math.pi
		phi = random.random()*math.pi - math.pi/2.0

		y = math.sin(phi)
		xz_len = math.cos(phi)
		x = xz_len*math.cos(theta)
		z = xz_len*math.sin(theta)

		print x + offsets[0], y + offsets[1], z + offsets[2], 
	else:
		for j in xrange(3):
			print random.random() + offsets[j],

	if (velocity):
		for j in xrange(3):
			print random.random() + voffsets[j],
	else:
		for j in xrange(3):
			print 0.0 + voffsets[j],

	print mass,
	print
